import org.junit.jupiter.api.Test;
import org.springframework.util.DigestUtils;

import java.io.FileNotFoundException;
import java.io.PrintStream;

/**
 * @author maozhongjin
 * @date 2021/6/23 14:48
 */
public class test {
    public void createCustomer (){
        String s = DigestUtils.md5DigestAsHex("123".getBytes());
        try {
            PrintStream printStream = new PrintStream("./s.sql");
            System.setOut(printStream);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        System.out.print("insert into shop.xq_customer" +
                "(customer_nickname, customer_pwd, customer_img, customer_phone, customer_address) " +
                "values");
        for (int i = 1; i < 20001; i++) {
//            System.out.println("  ('"+name+i+"','123','"+imp+"','13879589645','甘肃' ),");
            System.out.print("(");
            System.out.print(" 'tom" + i + "'");
            System.out.print(", '" + s + "'");
            System.out.print(", 'https://rjb-xqshoping.oss-cn-beijing.aliyuncs.com/shop/putong/20181118142953_yaktg.jpeg'");
            System.out.print(", '13879589645'");
            System.out.print(", '甘肃'");
            System.out.println(",'1758517300@qq.com'");
            System.out.println("),");
        }
    }
}

//     String pwd= "m12345";
//        String s = DigestUtils.md5DigestAsHex(pwd.getBytes());
//
//        System.out.println(s);
//    }
//}
